using System;
using System.Text;
using System.Data;
using System.Data.Common;
// using Microsoft.Practices.EnterpriseLibrary.Data;
//PSB 2006-05-26: should we use EntLib ExceptionPolicy.HandleException?
//using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using System.Reflection;
using System.ComponentModel;

namespace PantheonSoftware.InfoCollection
{
    
    //// <summary>
    //// Contains some helper functions
    ////   * PropertyFromFieldName:
    //// 
    //// </summary>                    
    public sealed class UtilityClass
    {
        
        //// <summary>
        //// This helper function converts a text field name into a
        //// PropertyDescriptor. This is useful when implementing many of
        //// the more complex interfaces
        //// </summary>
        //// <param name="type">The type of the class where the property
        ////                    is defined </param>
        //// <param name="field">The Field Name corresponding to the
        ////                     property The Field Name corresponding to
        ////                     the property</param>
        //// <returns>
        //// \Returns the PropertyDescriptor of the field 
        //// </returns>                                                  
        public static PropertyDescriptor PropertyFromFieldName(Type type, string field)
        {
            return TypeDescriptor.GetProperties(type).Find(field, false);
        }
    }
}
